import fastify from "fastify";
import mockData from "./data.js";

// 创建服务
const app = fastify();

// get请求: /jdapp/homepage
app.get("/jdapp/homepage", async (request, reply) => {
    return {
        code: 0,
        msg: 'success',
        data: mockData.homepage_data
    };
});

// 启动服务
app
    .listen({
        port: 3000
    })
    .then((address) => {
        console.log(`server listening on ${address}`);
    });
